/*
	Programação Concorrente
	Trabalho 2
	Turma A

	Adilson Abreu Couto Rapozo Junior ( n. USP: 6402336 )
	Luiz Alfredo Bertoni ( n. USP: 6418834 )
	Rodrigo Fernandes da Costa ( n. USP: 6793073 )
*/

#include "main.h"

int main ( int argc , char ** argv ) {

	int processId ; /* Rank */
	int numberOfProcess ; /* Number of process */

	MPI_Init ( & argc , & argv ) ;

	MPI_Comm_rank ( MPI_COMM_WORLD , & processId ) ;
	MPI_Comm_size ( MPI_COMM_WORLD , & numberOfProcess ) ;

	if ( processId == 0 ) {

		firstProcess ( numberOfProcess , argc , argv ) ;

	} else {

		regularProcess ( ) ;
	}

	MPI_Finalize ( ) ;

	return 0 ;
}

